/**
 * 插入排序
 */
Array.prototype.insertion = function(){
     for(let i = 1;i< this.length ; i++){
         
         let temp = this[i];
         let j = i-1; 
         while(j>=0 && this[j] > temp ){
               this[j+1] = this[j];
               j--;
         }
         this[j+1] = temp;
         
     }
}


let arr = [1,2,50,3,5,44,0,-4];
arr.insertion();
console.log(arr);